package wildcard.database;
import java.sql.Connection;
import java.sql.DriverManager;

public class DBManager {

	public static Connection getConnection() {
		try{
			Class.forName("com.mysql.jdbc.Driver");

			Connection con = DriverManager.getConnection(
					"jdbc:mysql://localhost/FOODORDERS",
					"root",
					"smart");
			System.out.println("接続しました");

			return con;

		} catch (Exception e) {
			throw new IllegalStateException(e);
		}
	}

	public static Connection getConnection(final String id, final String pass) {
		try{
			Class.forName("com.mysql.jdbc.Driver");

			Connection con = DriverManager.getConnection(
					"jdbc:mysql://localhost/FOODORDERS",
					id,
					pass);
			System.out.println("接続しました:" + id);

			return con;

		} catch (Exception e) {
			throw new IllegalStateException(e);
		}
	}
}
